<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp"%>
<%@ include file="/WEB-INF/common/header.jsp"%>

	<div>
		<div class="layui-fluid">
			<div class="layui-row layui-col-space1">
				<div class="layui-col-md12">
					<div class="layui-form-query">
						<form class="layui-form" id="query_form">
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-mid">发送类型：</label>
									<div class="layui-input-inline" style="width:100px;">
										<select name="type">
									   		<option value="">全部</option>
									        <option value="0">公众号</option>
									        <option value="1">小程序</option>
									   	</select>
									</div>
								</div>
								
								<div class="layui-inline">
									<label class="layui-form-mid">发送状态：</label>
									<div class="layui-input-inline" style="width:100px;">
										<select name="code">
									   		<option value="">全部</option>
									        <option value="0">成功</option>
									        <option value="1">失败</option>
									   	</select>
									</div>
								</div>
								
								<div class="layui-inline">
									<label class="layui-form-mid">发送用户：</label>
									<div class="layui-input-inline" style="width:250px;">
										<input type="text" name="openId" autocomplete="off" class="layui-input" placeholder="发送用户openId" />
									</div>
								</div>
								
								<div class="layui-inline">
									<label class="layui-form-mid">模版主键：</label>
									<div class="layui-input-inline" style="width:200px;">
										<input type="text" name="wxTempId" autocomplete="off" class="layui-input" placeholder="发送模版主键" />
									</div>
								</div>
								
								<div class="layui-inline">
									<div class="layui-input-inline">
										<button class="layui-btn" type="button" function="query"><i class="layui-icon">&#xe615;</i>查询</button>
										<button class="layui-btn layui-btn-danger" type="reset" function="clean">清空</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
				
				<div class="layui-col-md12">
					<div class="layui-row grid-demo">
						<div class="layui-col-md12">
							<button class="layui-btn layui-btn-sm" function="refresh">
								<i class="layui-icon">&#x1002;</i>刷新
							</button>
						</div>
						
						<div class="layui-col-md12">
							<table id="fsDatagrid" lay-filter="fsDatagrid" class="fsDatagrid"
								isLoad="1" url="${ctx }/wx/logs/list" isPage="1" sortType="1"
								pageSize="10" defaultForm="query_form" height="full-135"></table>

							<div class="fsDatagridCols">
								<p type="numbers" title="#"/>
								<p field="type" title="发送类型" width="150" sort="true" dict="wxTempType" />
								<p field="openId" title="发送用户" width="300" sort="true"/>
								<p field="code" title="发送状态" width="100" sort="true" templet="#sendCode"/>
								<p field="message" title="发送状态说明" width="200" sort="true" />
								<p field="formId" title="回查主键" width="200" sort="true" />
								<p field="wxTempId" title="发送模板主键" width="300" sort="true"/>
								<p align="center" toolbar="#actionTemp" title="操作" width="220"/>
							</div>
							
							<script type="text/html" id="sendCode">
								{{# if (d.code == 0) { }}
									<span class="layui-badge layui-bg-green">成功</span>
								{{# } else { }}
									<span class="layui-badge layui-bg-danger">失败</span>
								{{# } }}
							</script>

							<script type="text/html" id="actionTemp">
								<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="top" topUrl="${ctx }/wx/logs/detail" topMode="readonly" topWidth="680px" topHeight="500px" topTitle="微信日志详情" inputs="id:">查看</a>
							</script>
							 
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<%@ include file="/WEB-INF/common/bottom.jsp"%>
